<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="keywords" content="电视直播,国内电视，直播源，免费电视，m3u8工具">
        <meta name="description" content="电视直播源整合,免费的电视频道">
        <title>电视直播聚合-每日更新</title>
        <script src="https://cdn.bootcss.com/jquery/3.5.0/jquery.js"></script>
        <link href="https://cdn.bootcss.com/video.js/7.8.0/video-js.min.css" rel="stylesheet">
        <style>


            #playarea{
                overflow:hidden;clear:both;
                z-index: 999;
            }   

            #title {
                margin-bottom:4vh;
                font-size: 3vw;
                color:olivedrab;
            }


            #controlarea
            {
                margin-top:10vh;
                text-align: center;
                color: olivedrab;
                font-size: 3vw;
                font-weight: bold;
            }

        </style>
        

    </head>
    <body style="background-color:#eee;" >
        <h3 id="title"></h3>
        <div> 
            <h3 id="title"></h3>
        </div>
        <div id="playarea" >
            <section id="videoPlayer"  >
                <video id="example-video" x5-playsinline="" playsinline="" webkit-playsinline="" style="width: 100%;" class="video-js vjs-default-skin vjs-big-play-centered" poster="">
                    <source src="http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8" preload="auto" type="application/x-mpegURL" id="target">
                </video>
            </section>
        </div> 
        <div id="controlarea"> 

            <a onclick="closethiswindow()">关闭</button>
        </div>
        
        <script type="text/javascript">
        
        function closethiswindow()
        {
            var index=parent.layer.getFrameIndex(window.name); 
            parent.layer.close(index);
        }

        function getQueryVariable(variable)
        {
            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if(pair[0] == variable){return pair[1];}
            }
            return(false);
        }
        
        window.onload = function()
        {
            var address = getQueryVariable('address');
            var title = decodeURI(getQueryVariable('title'));

            if(address!=false && title !=false)
            {
                $("#title").html("当前频道："+title);
                var source = document.getElementById("target");
                source.src = address;
                
                var player = videojs('example-video', { "poster": "", "controls": "true" }, function() {
                    this.on('play', function() {
                    // console.log('正在播放');
                    });
                    //暂停--播放完毕后也会暂停
                    this.on('pause', function() {
                    // console.log("暂停中")
                    });
                    // 结束
                    this.on('ended', function() {
                    // console.log('结束');
                    });

                });  
            }
        }
        
        </script>


        <script src="https://cdn.bootcss.com/video.js/7.8.0/video.min.js"></script>
        <script src="https://cdn.bootcss.com/videojs-contrib-hls/5.15.0/videojs-contrib-hls.min.js"></script>
        <script>
            var _hmt = _hmt || [];
            (function() {
              var hm = document.createElement("script");
              hm.src = "https://hm.baidu.com/hm.js?8366b1d22e5787bdd43fc9bc472d435f";
              var s = document.getElementsByTagName("script")[0]; 
              s.parentNode.insertBefore(hm, s);
            })();
        </script>
    </body>
</html>